package week_three_day03.dom;

import java.io.FileInputStream;
import java.util.List;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.Namespace;
import org.jdom.input.SAXBuilder;

public class DomDemo02 {
	public static void main(String[] args) throws Exception {
		Document doc = new SAXBuilder().build(new FileInputStream("pom.xml"));
		Element root = doc.getRootElement();
		System.out.println("root:"+root.getName());
//		Element  dependencies= root.getChild("dependencies");
		List<Element> cs = root.getChildren();
//		Namespace type=Namespace.getNamespace("xsi","http://www.w3.org/2001/XMLSchema-instance");
		for(Element c:cs){
//			String attributeValue = c.getChildTextTrim("dependencies", type);
//			List<Element> dependency = c.getChildren("dependencies", type);
//			System.out.println(dependency);
//			Element dependency = c.getChild("dependencie");
//			String grouId =dependency.getChild("groupId").getTextTrim();
//			String artifactId = dependency.getChild("artifactId").getTextTrim();
//			String version = dependency.getChild("version").getTextTrim();
//			System.out.println(grouId+"\t"+artifactId+"\t"+version);
			if("dependencies".equals(c.getName())){
//				for()
			}
		}
	}
}
